package cn.gson.springboot.model.pojos;

import javax.persistence.*;
import java.sql.Date;
import java.util.Objects;

@Entity
@Table(name = "timeline_", schema = "crm", catalog = "")
public class Timeline {
    private int timelineId;
    private String timelineContent;
    private Date timelineTimestamp;
    private String timelineColor;
    private String timelineSize;
    private String timelineIcon;
    private String timelineType;
    private String timelineContentbody;
    private String timelineRouter;
    private Customer customerByCustomerId;

    @Id
    @Column(name = "timeline_id")
    public int getTimelineId() {
        return timelineId;
    }

    public void setTimelineId(int timelineId) {
        this.timelineId = timelineId;
    }

    @Basic
    @Column(name = "timeline_content")
    public String getTimelineContent() {
        return timelineContent;
    }

    public void setTimelineContent(String timelineContent) {
        this.timelineContent = timelineContent;
    }

    @Basic
    @Column(name = "timeline_timestamp")
    public Date getTimelineTimestamp() {
        return timelineTimestamp;
    }

    public void setTimelineTimestamp(Date timelineTimestamp) {
        this.timelineTimestamp = timelineTimestamp;
    }

    @Basic
    @Column(name = "timeline_color")
    public String getTimelineColor() {
        return timelineColor;
    }

    public void setTimelineColor(String timelineColor) {
        this.timelineColor = timelineColor;
    }

    @Basic
    @Column(name = "timeline_size")
    public String getTimelineSize() {
        return timelineSize;
    }

    public void setTimelineSize(String timelineSize) {
        this.timelineSize = timelineSize;
    }

    @Basic
    @Column(name = "timeline_icon")
    public String getTimelineIcon() {
        return timelineIcon;
    }

    public void setTimelineIcon(String timelineIcon) {
        this.timelineIcon = timelineIcon;
    }

    @Basic
    @Column(name = "timeline_type")
    public String getTimelineType() {
        return timelineType;
    }

    public void setTimelineType(String timelineType) {
        this.timelineType = timelineType;
    }

    @Basic
    @Column(name = "timeline_contentbody")
    public String getTimelineContentbody() {
        return timelineContentbody;
    }

    public void setTimelineContentbody(String timelineContentbody) {
        this.timelineContentbody = timelineContentbody;
    }

    @Basic
    @Column(name = "timeline_router")
    public String getTimelineRouter() {
        return timelineRouter;
    }

    public void setTimelineRouter(String timelineRouter) {
        this.timelineRouter = timelineRouter;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Timeline timeline = (Timeline) o;
        return timelineId == timeline.timelineId &&
                Objects.equals(timelineContent, timeline.timelineContent) &&
                Objects.equals(timelineTimestamp, timeline.timelineTimestamp) &&
                Objects.equals(timelineColor, timeline.timelineColor) &&
                Objects.equals(timelineSize, timeline.timelineSize) &&
                Objects.equals(timelineIcon, timeline.timelineIcon) &&
                Objects.equals(timelineType, timeline.timelineType) &&
                Objects.equals(timelineContentbody, timeline.timelineContentbody) &&
                Objects.equals(timelineRouter, timeline.timelineRouter);
    }

    @Override
    public int hashCode() {
        return Objects.hash(timelineId, timelineContent, timelineTimestamp, timelineColor, timelineSize, timelineIcon, timelineType, timelineContentbody, timelineRouter);
    }
}
